#ifndef _BEEP_H_
#define _BEEP_H_

//=========BEEP=========//
 
#define BUZZER_IO_TYPE	1		//1:PCK 0:IO 

#define BEEP_200MS 		1
#define BEEP_DOUBLE 	2
#define BEEP_1000MS 	3
#define BEEP 			BUZZER_CTRL_IO

#if  BUZZER_IO_TYPE == 1
	//pb1 pck    
	#define BEEP_ON()		{_pcken = 1;_pckd = 1;_pckpol = 1;_pckpsc3 = 0;_pckpsc2 = 1;_pckpsc1 = 1;_pckpsc0 = 1;}
	#define BEEP_OFF()		{_pcken = 0;_pckd = 0;_pckpol = 0;_pckpsc3 = 0;_pckpsc2 = 1;_pckpsc1 = 1;_pckpsc0 = 1;}
#elif BUZZER_IO_TYPE == 0	
	//io
	#define BEEP_ON()		{BEEP=~BEEP;}
	#define BEEP_OFF()   	{BEEP = 1;}
#endif	//end of BUZZER 

//=========FAN=========//
#if FAN_IO_TYPE == 1	// pck—> pb1
	#define FAN_ON()			{_pcken = 0;_pckd = 0; _pckpol = 1;} 
	#define FAN_OFF()			{_pcken = 0;_pckd = 0; _pckpol = 0;} // PCK DISABLE ,OUTPUT L  
#endif//end of FAN 

void Beep_Init(void);
void Beep_Task(void); // 20ms
void Fan_Task(void); 

extern vu8 Beep_Cmd;
extern vu16 Beep_Cnt;

#endif